load("@rules_cc//cc:cc_library.bzl", "cc_library")
load("@rules_python//python:defs.bzl", "py_library")
load(":tests.bzl", "nb_test")

package(
    default_testonly = True,
    features = [
        "parse_headers",
        "layering_check",
    ],
)

cc_library(
    name = "inter_module",
    testonly = True,
    srcs = ["inter_module.cpp"],
    hdrs = ["inter_module.h"],
    copts = select({
        "@rules_cc//cc/compiler:msvc-cl": ["/std:c++17"],
        "//conditions:default": ["--std=c++17"],
    }),
    deps = [
        "//:nanobind",
    ],
)

py_library(
    name = "common",
    testonly = True,
    srcs = ["common.py"],
    imports = ["."],
)

[
    nb_test(name = name)
    for name in [
        "accessor",
        "functions",
        "callbacks",
        # "classes", # TODO: Fix class mismatch
        "holders",
        "stl",
        "stl_bind_map",
        "stl_bind_vector",
        "chrono",
        "enum",
        "eval",
        # "ndarray", # TODO: Not supported
        # "jax", # TODO: Not supported
        # "tensorflow", # TODO: Not supported
        "exception",
        "make_iterator",
        "typing",
        "issue",
        # "intrusive", # TODO: Not supported
        "thread",
    ]
]
